﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hospital.Model.entity
{
    [SugarTable("PurchaseOrder")]
    public class PurchaseOrder : BaseId
    {
        [SugarColumn(Length = 20, IsNullable = false)]
        public string OrderNo { get; set; } // 采购单号（PO20231101001）

        [SugarColumn(IsNullable = false)]
        public DateTime PurchaseDate { get; set; } // 采购日期

        [SugarColumn(Length = 50, IsNullable = false)]
        public string Supplier { get; set; } // 供应商

        [SugarColumn(DecimalDigits = 2, IsNullable = false)]
        public decimal TotalAmount { get; set; } // 总金额

        [SugarColumn(Length = 20, IsNullable = false)]
        public string Purchaser { get; set; } // 采购人

        [SugarColumn(IsNullable = true)]
        public string Remark { get; set; } // 备注

        [Navigate(NavigateType.OneToMany, nameof(PurchaseDetail.OrderId))]
        public List<PurchaseDetail> Details { get; set; } // 采购明细
    }
}
